using System;
using System.Collections.Generic;
using System.Text;
using System.Resources;
using System.Diagnostics;
using Microsoft.BizTalk.TransportProxy.Interop;

namespace Microsoft.Samples.BizTalk.Adapter.Tcp
{
    /// <summary>
    ///     This interface is required for all basic adapters.
    /// </summary>
    /// <author>
    ///     Paul Brown
    /// </author>
    public interface IAdapter
    {
        #region Properties

        /// <summary>
        ///     This property returns a reference to the trace switch used by the adapter.
        /// </summary>
        TraceSwitch TraceSwitch
        {
            get;
        }

        /// <summary>
        ///     This property returns a reference to the trace switch used by the adapter when sending and receiving data over the socket.
        /// </summary>
        TraceSwitch SocketTraceSwitch
        {
            get;
        }

        /// <summary>
        ///     This property returns a reference to the transport proxy associated with this adapter.
        /// </summary>
        IBTTransportProxy TransportProxy
        {
            get;
        }

        /// <summary>
        ///     This property returns a reference to the work dispatcher associated with this adapter.
        /// </summary>
        Dispatcher Dispatcher
        {
            get;
        }

        /// <summary>
        ///     This property returns a reference to the folder where dead messages that cannot be delivered to BizTalk are saved.
        /// </summary>
        string DeadMessageFolder
        {
            get;
        }

        #endregion

        #region Methods

        /// <summary>
        ///     This method restarts the adapter.  In other words, if the dispatcher were to fail, then this enables
        ///     the adapter to re-initialize its state (except configuration) as if starting up for the first time.
        /// </summary>
        void RestartAdapter(Exception e);

        #endregion
    }
}
